package com.flybear.aqi.client;


import org.elasticsearch.action.index.IndexRequest;
import org.elasticsearch.action.index.IndexRequestBuilder;

import java.io.IOException;
import java.text.DateFormat;
import java.util.Map;
import java.util.TimeZone;

/**
 * Interface for creating ElasticSearch {@link IndexRequest} instances
 * from serialized flume events. This is configurable, so any config params
 * required should be taken through this.
 */
public interface ElasticSearchIndexRequestBuilderFactory  {

  /**
   * ElasticSearch to prepare index from
   * @param indexPrefix
   *          Prefix of index name to use -- as configured on the sink
   * @param indexType
   *          Index type to use -- as configured on the sink
   * @param event
   *          Flume event to serialize and add to index request
   * @return prepared ElasticSearch {@link IndexRequestBuilder} instance
   * @throws IOException
   *           If an error occurs e.g. during serialization
   */
  IndexRequest createIndexRequest(String indexPrefix,
                                  String indexType, Map event) throws IOException;



}
